﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class lienhe : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            txtTenKH.Text = "";
            txtnoidung.Text = "";
            txtemail.Text = "";
            txtdienthoai.Text = "";
            txtdiachi.Text = "";
            txtchude.Text = "";
            txtTenKH.Focus();
        }

    }
    YKIENKHController YKienCTR = new YKIENKHController();
    protected void btgui_Click(object sender, EventArgs e)
    {
        YKienKhachHangEntity YKienE = new YKienKhachHangEntity();
        YKienE.TieuDe = txtchude.Text;
        YKienE.TenKH = txtTenKH.Text;
        YKienE.NgayGui = DateTime.Now;
        YKienE.NoiDung = txtnoidung.Text;
        YKienE.Email = txtemail.Text;
        YKienE.DienThoai = txtdienthoai.Text;
        YKienE.DiaChi = txtdiachi.Text;
        YKienCTR.fnC_InsertYKienKhachHang(YKienE);
        ScriptManager.RegisterStartupScript(this, this.GetType(), "alert",
                       "alert('Cảm ơn bạn đã gửi ý kiến!');location.href='default.aspx';", true);
    }
}